Skip to content

Move to Polhem.JsonRpc 1.4.0 and refuse streaming methods in PolhemMethodPolicy - #644

Merged
jeff377 merged 3 commits into
mainfrom
claude/jsonrpc-1.4.0
Dec 2, 2026
Merged

jeff377 merged 3 commits into
mainfrom
claude/jsonrpc-1.4.0

Conversation

@jeff377

@jeff377 jeff377 commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Moves the framework from Polhem.JsonRpc 1.2.0 to 1.4.0 (release notes).

Version

PolhemJsonRpc.props pins [1.4.0]. The two project templates and the dotnet add package lines of README, README.zh-TW and both getting-started documents follow; TemplateJsonRpcVersionTests checks that they agree.

PolhemMethodPolicy refuses streaming methods

Since 1.3.0 the dispatcher's JsonRpcMethod.IsResolvableAction also resolves a method whose second parameter is an IJsonRpcStream<T>, and leaves the decision to the method policy. PolhemMethodPolicy looked only for ApiAccessControlAttribute, so on a business object declared at class level such a method would become an action, and its items would leave without ApiOutputConverter, which PolhemPayloadFilter applies to the return value only. No business object has one today. The policy now admits methods with one parameter only.

  • PolhemMethodPolicyTests: a streaming method is refused whether it declares its access itself or through its class. Removing the parameter check turns both cases red.
  • The POLHEM3001 analyzer's remarks, ActionPayloadType.Resolve and .claude/rules/security.md credited IsResolvableAction alone with the one-parameter shape; they now name the policy.

What else 1.3.0 and 1.4.0 change, checked against the framework

  • Payload bodies under 256 bytes are written uncompressed. Polhem readers since 1.3.0 and polhem-connector-js read them.
  • A call whose Accept names text/event-stream is treated as streamed. RemoteApiProvider and its header handler set no Accept, polhem-connector-js sends none, and */* does not count, so deployed clients are not affected.
  • PayloadConnector.InvokeAsync without a result type now verifies the result; ApiConnector uses InvokeAsync<object> only.
  • The ProgId rpc is no longer found; the framework has none.
  • The wire bytes of 1.4.0 are those of 1.3.0.

Checks

  • dotnet build Polhem.slnx -c Release --no-incremental against the published 1.4.0 packages: succeeded.
  • dotnet test Polhem.slnx: everything passes except four tests that fail on main as well on this machine: DbAccessCompanyBindingTests (two) and BusinessObjectPropertyTests.ResolveDatabaseId_CommonScope_ReturnsNonEmptyDatabaseId (no connection string for common), and PolhemAvaloniaTemplateTests.Generate_iOS_Builds (MT7199 from the local iOS SDK).
  • check-xmldoc-refs.sh, check-md-links.sh: passed.
  • Adversarial review of the bump, from a caller's and from the downstream clients' side: the policy gap above was its finding; nothing else blocking.

The release notes of the next framework version should list the move to 1.4.0.

…thodPolicy

The pin in PolhemJsonRpc.props, the project templates and the install
commands of the READMEs and getting-started documents move from 1.2.0 to
1.4.0.

Since 1.3.0 the dispatcher also resolves a method whose second parameter is
an IJsonRpcStream<T> and leaves it to the method policy. PolhemMethodPolicy
looked only for ApiAccessControlAttribute, so a business object declared at
class level would publish such a method, and its items would leave without
ApiOutputConverter. The policy now admits methods with one parameter only;
PolhemMethodPolicyTests covers both the method-level and the class-level
declaration. The POLHEM3001 analyzer, ActionPayloadType and the security
rule describe the narrowing instead of crediting IsResolvableAction alone.
…the Api.Server README describe what an action reaches
@jeff377
jeff377 enabled auto-merge December 2, 2026 07:12
@jeff377
jeff377 added this pull request to the merge queue Dec 2, 2026
Merged via the queue into main with commit fa5b296 Dec 2, 2026
4 checks passed
@jeff377
jeff377 deleted the claude/jsonrpc-1.4.0 branch December 2, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant